package C2;
import C1.Circle;

import java.util.Scanner;

public class Cone {
    Double h;
    Circle c;
    Cone(Double radius,Double h){
        c = new Circle(radius);
        this.h=h;
    }
    Double getarea(){
        double l =Math.sqrt(h*h+c.radius*c.radius);
        return 3.14*c.radius*l+c.getarea();
    }
    Double getvolume(){
        return (c.getarea()*h)/3;
    }

    public static void main(String[] args) {
        System.out.println("请输入圆锥的高");
        Scanner sc =new Scanner(System.in);
        double h = sc.nextDouble();
        System.out.println("请输入圆锥的半径");
        double radius = sc.nextDouble();
        Cone c = new Cone(radius,h);
        System.out.println("圆锥的表面积为");
        System.out.println(c.getarea());
        System.out.println("圆锥的体积为");
        System.out.println(c.getvolume());
    }
}
